-
Notifications
You must be signed in to change notification settings - Fork 348
[HIP] add test for uses of std::array on device code #244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
External/CUDA/array.cu
Outdated
__global__ void kernel() { do_test(); } | ||
|
||
int main() { | ||
kernel<<<32, 32>>>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can std::array be parameter type of kernel or device functions?
can it be used as non-constexpr stack variable in kernel or device functions?
if so, can we have testcases for those?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can std::array be parameter type of kernel or device functions?
It can be used as a parameter for device and kernel functions (which would trigger the copy-constructor). According to the c++ reference std::array
is an aggregate in the the same way as a struct with an array inside; so the same rules should apply. For example, all the constructors are implicitly declared.
I'm not sure that adding the copy-constructor case here will improve the coverage of the test (we're testing the interaction with the standard C++ library, and there is no code to test since these behaviors are implicitly defined by clang). Passing an aggregate as an argument should be covered by the tests on clang's side.
I can add the test for std::array
constructors here too if you think we really need them.
can it be used as non-constexpr stack variable in kernel or device functions?
This is already covered in the test. We check std::array
both in a constexpr and non-constexpr context.
e9f5343
to
2731dd1
Compare
2731dd1
to
631eac0
Compare
I've moved the array test from CUDA to HIP since I have less control over CUDA buildbots. The hipify tests are already merged. |
Would you be ok to:
|
The commit appears to break CUDA tests:
|
@@ -63,6 +63,7 @@ macro(create_local_cuda_tests VariantSuffix) | |||
list(APPEND CUDA_LOCAL_TESTS assert) | |||
list(APPEND CUDA_LOCAL_TESTS axpy) | |||
list(APPEND CUDA_LOCAL_TESTS algorithm) | |||
list(APPEND CUDA_LOCAL_TESTS array) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no matching array.cu file committed under CUDA which makes cmake configuration fail.
First attempt at testing llvm/llvm-project#136133 .
Draft for the moment, I have to manually test this further.